The present invention relates to a displacement compensation apparatus for machine tools to compensate displacement resulting from centrifugal force and heat generation caused by spindle rotation in a machine tool.
Conventionally, an apparatus to compensate heat displacement of a spindle based on temperature changes on the spindle is known as a heat displacement compensation apparatus to compensate heat displacement resulting from heat generation caused by rotation of the spindle in the machine tool.
In the above displacement compensation apparatus, compensation a correlation between the displacement of the spindle and a difference in temperature between places where a heat displacement is most likely to occur and where change in temperature is relatively small is examined in advance, for instance, a difference in temperature between near the spindle and the bed. A compensation value corresponding to the difference in temperature is calculated from the correlation, and the heat displacement is compensated based on the compensation value. But the conventional compensation method of heat displacement has a disadvantage that a difference is often found between an actual heat displacement of a spindle and a compensation value derived from the compensation calculation based on the difference in temperature, when the spindle is rotated at a random rotation frequency.
It is clear from FIG. 8 that a large deviation is found between a measured value and a compensation value obtained from the conventional compensation calculation, when the displacement of the spindle is measured after the spindle is rotated at rotation frequencies of, for instance, 1000 rpm, 3000 rpm, 0 (suspension), 2000 rpm, 3000 rpm, 1000 rpm for each 40 minutes and after leaving in suspension for 120 minutes.
When a spindle rotates, the spindle is expanded by centrifugal force. There is a disadvantage that an expansion of a spindle by centrifugal force makes the spindle shorten affected by the Poisson""s effect, so that the position of the tool retreats to that extent from the product in process.
In the conventional heat displacement compensation method, as the compensation value is determined by the difference in temperature, it is impossible to compensate instant displacement caused by a change in the rotation frequency of the spindle.
The object of the present invention is to provide a displacement compensation apparatus for machine tools to precisely compensate displacement resulting from centrifugal force or heat generation caused by rotating spindle rotation even when the spindle is randomly rotated.
A displacement compensation apparatus for machine tools according to the present invention is to compensate a displacement resulting from centrifugal force and heat generation caused by rotation of a spindle in a machine tool. The apparatus is provided with; a historical data table storing a history of function values of rotation frequency of the spindle in each time period from present to past; a corrective coefficient table in which corrective coefficients are stored in advance relating the coefficients to the corresponding location in the historical data table and a compensation process means. The compensation process means reads out each location and each corrective coefficient which corresponds to the location from the corrective coefficient table and concurrently reads out a function value for the rotation frequency of the spindle at the corresponding location from the historical data table, calculates a compensation value from the function value at each location and the corresponding corrective coefficient, and compensates a commanded position of each shaft in the machine tool based on the compensation values.
The corrective coefficient is determined by collecting and storing measured data on displacement of the spindle, shaft rotation time data and rotation frequency data when the spindle is randomly rotated with changing the shaft rotation frequency and by processing a regression calculation based on these data.
The function value of the rotation frequency of the spindle is a value proportional to the square of the spindle rotation frequency, or a value based on the proportional value to the square of the spindle rotation frequency, with compensation by other value.
For instance, the function value is obtained from dividing a square of the rotation frequency of the spindle by 16384 and subtracting one tenth of the rotation frequency of the spindle. The number thus derived is used as the function value. The equation is expressed as follows.
xe2x80x83Functional equation=(rotation frequencyxc3x97rotation frequency/16384) xe2x88x920.1xc3x97rotation frequencyxe2x80x83xe2x80x83(1)
In another example, a function value is calculated as a square of the rotation frequency of the spindle is divided by 16384 and further divided by one plus a number of three times of inverse of the natural logarithm of the rotation frequency divided by 25000. The functional equation is expressed as follows.
Functional equation=(rotation frequencyxc3x97rotation frequency/16384/(1.0+3.0/exp(rotation frequency/25000))xe2x80x83xe2x80x83(2)
In general, as centrifugal force is proportional to a square of a rotation frequency of a spindle, a displacement which is proportional to centrifugal force is also proportional to a square of the rotation frequency of the spindle. And as long as a force acting on the spindle and a friction coefficient stay constant, the friction torque is in proportion to the rotation frequency of the spindle. As friction is a product of friction torque and rotation frequency, it is proportional to a square of the rotation frequency of the spindle. Heat generation is a result of consumed energy by friction, it is also proportional to a square of the rotation frequency of the spindle. Hence, when a value which is proportional to a square of a spindle rotation frequency is used as a function value of the spindle rotation frequency, the accuracy of compensation can be improved.
In actuality, as a force acting on the spindle tends to increase with the increase of the rotation frequency, beat generation changes more sharply than a proportion to a square of the rotation frequency of the spindle. Consequently, as a function value for the rotation frequency of the spindle, a number proportional to a square of the spindle rotation frequency as a main component and compensated by another number is used. Then the accuracy of compensation is much improved.
In compensating displacement, each stored location and corrective coefficient are read out from the corrective coefficient, concurrently the function value of the spindle rotation frequency in each location is read out from the historical data table. And the compensation value is calculated from the function value in each location and the corresponding corrective coefficient.
Now, each location which is read out from the corrective coefficient table is taken as k00, k01, k02, . . . km, and corresponding each corrective coefficient as b00, b01, b02, . . . bm. And the function value of the spindle rotation frequency at each location read out from the historical data table is taken as R(k00), R(k01), R(k02), . . . R(km), then the displacement amounts xcex4 is calculated from the following equation.
xcex4=R(k00)xc3x97b00+R(k01)xc3x97b01+R(k02)xc3x97b02 . . . +R(km)xc3x97bmxe2x80x83xe2x80x83(3)
The compensation value xcex5 is obtained by changing the signs of the displacement amount xcex4.
More specifically, as the corrective coefficient value obtained from the equation (3) is very small, 4194304 times of the corrective coefficient value is stored and the displacement amount xcex4 is obtained from dividing the calculated value by 4194304.
For instance, when compensating three axes X, Y and Z, the location read out from the corrective coefficient table are expressed as k00, k01, k02 . . . km the corrective coefficient in X axis corresponding to the above location are b00x, b01x, b02x, . . . bmx, the corrective coefficient in Y axis corresponding to the location are b00y, b01y, b02y, . . . bmy, and the corrective coefficient in Z axis are b00z, b01z, b02z, . . . bmz. And the function values of rotation frequency of the spindle at each location read out from the historical data table are expressed as R(k00), R(k01), R(k02), . . . R(km). The displacement amounts for each axis xcex4X, xcex4y, xcex4z can be obtained by the following equations. xcex4X=(R(k00)xc3x97b00x+R(k01)xc3x97b01x+R(k02)xc3x97b02x . . . R(km)xc3x97bmx)/4194304
xcex4y=(R(k00)xc3x97b00y+R(k01)xc3x97b01y+R(k02)xc3x97b02y . . . R(km)xc3x97bmy)/4194304
xcex4z=(R(k00)xc3x97b00y+R(k01)xc3x97b01y+R(k02)xc3x97b02y . . . R(km)xc3x97bmy)/4194304xe2x80x83xe2x80x83(4)
A compensation value is a value of which absolute number is the same as the displacement amount and which is shown in opposite signs. Therefore, compensation values for the axes (X, Y, and Z axis) xcex5x, xcex5y, xcex5z, are obtained from the following equation.
xcex5X=xe2x88x92xcex4x, xcex5y=xe2x88x92xcex4y, xcex5z=xe2x88x92xcex4zxe2x80x83xe2x80x83(5)
Accordingly, the compensation value is calculated from the corrective coefficient considering the rotation time, rotation frequency, elapsed time of the spindle, and the function value of the spindle rotation frequency. As the command position of the machine tool is compensated based on the compensation value, the displacement resulting from centrifugal force caused by the rotation of the spindle or heat generation spindle can be compensated with high accuracy even when the spindle is randomly rotated.
That is, in a conventional compensation method, the compensation value is calculated based on a temperature difference at that time. When the spindle is randomly rotated, the compensation value for heat displacement of the spindle varies from small number to big number. And it is impossible to compensate the displacement resulting from changes in rotation frequency of the spindle. But the apparatus according to the present invention gives a compensation value having little difference from the true displacement of the spindle even when the spindle is rotating at a random speed and also compensates a displacement caused by centrifugal force. Thus the apparatus according to the present invention can achieve highly accurate compensation.
It is preferable that the function values are stored in the data table at relatively short time intervals while the spindle is rotating and at relatively long time intervals while the spindle is halted. For instance, the function values are stored at intervals from 20 seconds to one minute while the spindle is rotating and stored at intervals from one minute to 3 minutes while the spindle is halted.
In this way, a precise compensation of the displacement can be achieved with a single table while the spindle is rotated and also while the spindle is halted. Incidentally, displacement characteristics of the spindle in rotation is different from displacement characteristics of the spindle in suspension. If the function values are renewed and stored still at the same time intervals, the compensation value derived may contain some error. This may be considered as a disadvantage of the method. But the method according to the present invention ensures an accurate compensation of the displacement with one table for both in rotation and in suspension of the rotation of the spindle.
It is also preferable that the locations in the data table are arranged in an order reverse to elapsed time.
Most of presently available micro processing units for the computer (it will be abbreviated to MPU hereafter) are provided with a batch transfer function of its memory contents. It takes shorter time for carrying out processing with the batch transfer function provided in the MPU than to make and use programs of reading out individual data from a source address and writing in a destination address. But in this function, the processing is sequentially carried out from an address of a lower order to higher order. Accordingly, when the range of address in source address is overlapped with the range of address in destination address and if the destination address is in higher order than the order of the source address, the overlapped range area can not be processed correctly. In the present invention, as the locations in the data table are arranged in an order reverse to elapsed time, the above described problem can be avoided.
Moving averages(xe2x80x9cryu-do heikinxe2x80x9d in Japanese) of the function values of predetermined plural locations in the past time period may be stored in the data table at the time of data renewal, and one corrective coefficient value in correspondence to the time period above described may be stored in the corrective coefficient table.
Then, the size (the number of lines) of the corrective coefficient table can be reduced and the speed for the compensation calculation can be improved.
For the value stored in the historical data table, the rotation frequency of the spindle itself can be used instead of the function value of the spindle rotation frequency.
In such cases, the compensation procedure is as follows. A location in the historical data table and the corresponding corrective coefficient are read out from the corrective coefficient table and at the same time the rotation frequency of the spindle in the location is read out from the historical data table. The function values are calculated from the rotation frequencies of the spindle in the locations as necessary. And with the corresponding corrective coefficients the calculations of the corrective values are carried out. Then, the commanded position for each shaft of the machine tool is compensated based on the corrective values.